﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Matryoshka
{
    public class UpdateEventArgs : EventArgs
    {
        private float dtime = 0f;
        public float DeltaTime
        {
            get { return dtime; }
        }

        public UpdateEventArgs(float dtime)
        {
            this.dtime = dtime;
        }
    }

    // A delegate type for hooking up change notifications.
    public delegate void UpdateEventHandler(object sender, UpdateEventArgs e);

    public abstract class Decal
    {
        public bool done = false;

        public event UpdateEventHandler UpdateEvent;

        // Invoke the Changed event; called whenever list changes
        protected virtual void OnUpdate(UpdateEventArgs e)
        {
            if (UpdateEvent != null)
                UpdateEvent(this, e);
        }

        public virtual void Update(float dtime)
        {
            OnUpdate(new UpdateEventArgs(dtime));
        }

        public abstract void Draw(SpriteBatch spriteBatch);
    }
}
